﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/Content/css/daterangepicker-bs3.css" type="text/css" media="all" rel="stylesheet" />
    <script src="../Scripts/jquery-1.7.1.min.js"></script>
    <!-- Bootstrap core CSS     -->
    <link href="../Content/css/bootstrap.min.css" rel="stylesheet" />

    <!--  Light Bootstrap Dashboard core CSS    -->
    <link href="../Content/css/light-bootstrap-dashboard.css" rel="stylesheet" />

    <!--  CSS for Demo Purpose, don't include it in your project     -->
    <link href="../Content/css/demo.css" rel="stylesheet" />


    <!--     Fonts and icons     -->
    <link href="../Content/css/font-awesome.min.css" rel="stylesheet">
    <link href='../Content/css/685fd913f1e14aebad0cc9d3713ee469.css' rel='stylesheet' type='text/css'>
    <link href="../Content/css/pe-icon-7-stroke.css" rel="stylesheet" />
    @* @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")*@
</head>
<body>
    <div class="wrapper">
        <div class="sidebar" data-color="azure" data-image="../../Content/picture/full-screen-image-4.jpg">
            <!--

            Tip 1: you can change the color of the sidebar using: data-color="blue | azure | green | orange | red | purple" 更换菜单颜色
            Tip 2: you can also add an image using data-image tag 更换菜单图片

        -->

            <div class="logo">
                <a href="#" class="logo-text">BWAP
                </a>
            </div>
            <div class="logo logo-mini">
                <a href="#" class="logo-text">BWAP
                </a>
            </div>

            <div class="sidebar-wrapper">
                <!--个人信息-->
                <div class="user">
                    <div class="photo">
                        <img src="~/Content/picture/111.png" />
                    </div>
                    <div class="info">
                        <a data-toggle="collapse" href="#collapseExample" class="collapsed">1111
                            <b class="caret"></b>
                        </a>
                        <div class="collapse" id="collapseExample">
                            <ul class="nav">
                                <li><a href="#">我的简介</a></li>
                                <li><a href="#">编辑质料</a></li>
                                <li><a href="#">设置</a></li>
                            </ul>
                        </div>
                    </div>
                </div>

                <!--导航菜单-->
                <ul class="nav">

                    <li class="list">
                        <a data-toggle="collapse" href="#ManageBooks">
                            <i class="pe-7s-bookmarks"></i>
                            <p>
                                图书管理
                           <b class="caret"></b>
                            </p>
                        </a>
                        <div class="collapse" id="ManageBooks">
                            <ul class="nav">
                                @using Model;
                                @foreach (var item in (List<Permission>)Session["PermissionList"])
                                {
                                    if (item.GroupUp == 0)
                                    {
                                    <li><a href="@item.PermissionHref">@item.PermissionName</a></li>
                                    }
                                }
                            </ul>
                        </div>
                    </li>

                    <li class="list">
                        <a data-toggle="collapse" href="#Order">
                            <i class="pe-7s-note2"></i>
                            <p>
                                订单管理
                           <b class="caret"></b>
                            </p>
                        </a>
                        <div class="collapse" id="Order">
                            <ul class="nav">
                                @foreach (var item in (List<Permission>)Session["PermissionList"])
                                {
                                    if (item.GroupUp == 1)
                                    {
                                    <li><a href="@item.PermissionHref">@item.PermissionName</a></li>
                                    }
                                }
                            </ul>
                        </div>
                    </li>

                    <li class="list">
                        <a data-toggle="collapse" href="#Inventory">
                            <i class="pe-7s-browser"></i>
                            <p>
                                统计报表
                           <b class="caret"></b>
                            </p>
                        </a>
                        <div class="collapse" id="Inventory">
                            <ul class="nav">
                                @foreach (var item in (List<Permission>)Session["PermissionList"])
                                {
                                    if (item.GroupUp == 3)
                                    {
                                    <li><a href="@item.PermissionHref">@item.PermissionName</a></li>
                                    }
                                }
                            </ul>
                        </div>
                    </li>

                    <li class="list">
                        <a data-toggle="collapse" href="#Product">
                            <i class="pe-7s-user"></i>
                            <p>
                                管理账号
                           <b class="caret"></b>
                            </p>
                        </a>
                        <div class="collapse" id="Product">
                            <ul class="nav">
                                @foreach (var item in (List<Permission>)Session["PermissionList"])
                                {
                                    if (item.GroupUp == 4)
                                    {
                                    <li><a href="@item.PermissionHref">@item.PermissionName</a></li>
                                    }
                                }
                            </ul>
                        </div>
                    </li>



                    <li class="list">
                        <a data-toggle="collapse" href="#System">
                            <i class="pe-7s-config"></i>
                            <p>
                                系统设置
                           <b class="caret"></b>
                            </p>
                        </a>
                        <div class="collapse" id="System">
                            <ul class="nav">
                                @foreach (var item in (List<Permission>)Session["PermissionList"])
                                {
                                    if (item.GroupUp == 2)
                                    {
                                    <li><a href="@item.PermissionHref">@item.PermissionName</a></li>
                                    }
                                }
                            </ul>
                        </div>
                    </li>
                </ul>
                <!--结束-->
                <script>
                    $(function () {
                        $(".list ul").each(function () {
                            //alert();
                            if (!$(this).is(":has(li)")) {
                                $(this).parent("div").parent("li").remove();
                            }
                        });

                    });
                </script>
            </div>


        </div>
        <div class="main-panel">

            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    @*<div class="navbar-minimize">
                        <button id="minimizeSidebar" class="btn btn-warning btn-fill btn-round btn-icon">
                            <i class="fa fa-ellipsis-v visible-on-sidebar-regular"></i>
                            <i class="fa fa-navicon visible-on-sidebar-mini"></i>
                        </button>
                    </div>*@
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#">@ViewBag.title</a>
                    </div>
                    <div class="collapse navbar-collapse">

                        <form class="navbar-form navbar-left navbar-search-form" role="search">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                <input type="text" value="" class="form-control" placeholder="Search...">
                            </div>
                        </form>

                        <ul class="nav navbar-nav navbar-right">
                            @*<li>
                                <a href="../charts.html">
                                    <i class="fa fa-line-chart"></i>
                                    <p>统计数据</p>
                                </a>
                            </li>*@

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-gavel"></i>
                                    <p class="hidden-md hidden-lg">
                                        行动
                                    <b class="caret"></b>
                                    </p>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">创建新岗位</a></li>
                                    <li><a href="#">管理某事</a></li>
                                    <li><a href="#">什么也不做</a></li>
                                    <li><a href="#">屈服于生活</a></li>
                                    <li class="divider"></li>
                                    <li><a href="#">另一行动</a></li>
                                </ul>
                            </li>

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-bell-o"></i>
                                    <span class="notification">5</span>
                                    <p class="hidden-md hidden-lg">
                                        通知
    								<b class="caret"></b>
                                    </p>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">Notification 1</a></li>
                                    <li><a href="#">Notification 2</a></li>
                                    <li><a href="#">Notification 3</a></li>
                                    <li><a href="#">Notification 4</a></li>
                                    <li><a href="#">Another notification</a></li>
                                </ul>
                            </li>

                            <li class="dropdown dropdown-with-icons">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-list"></i>
                                    <p class="hidden-md hidden-lg">
                                        更多
    								<b class="caret"></b>
                                    </p>
                                </a>
                                <ul class="dropdown-menu dropdown-with-icons">
                                    <li>
                                        <a href="#">
                                            <i class="pe-7s-mail"></i>信息
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="pe-7s-help1"></i>帮助中心
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="pe-7s-tools"></i>设置
                                        </a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <a href="#">
                                            <i class="pe-7s-lock"></i>锁定屏幕
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#" class="text-danger">
                                            <i class="pe-7s-close-circle"></i>
                                            注销
                                        </a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            @*<!--页中内容-->*@
            <div class="content">
                @RenderBody()
            </div>
            <footer class="footer">
                <div class="container-fluid">
                    <nav class="pull-left">
                        <ul>
                            <li>
                                <a href="/Home/Index">首页
                                </a>
                            </li>
                            <li>
                                <a href="#">单位
                                </a>
                            </li>
                            <li>
                                <a href="#">文件夹
                                </a>
                            </li>
                            <li>
                                <a href="#">博客
                                </a>
                            </li>
                        </ul>
                    </nav>
                    <p class="copyright pull-right">
                        &copy; 2018-9-11 <a href="#">BWAP</a>, The persistence from Wu Yuheng
                    </p>
                </div>
            </footer>
        </div>
    </div>

    <div class="fixed-plugin">
        <div class="dropdown">
            <a href="#" data-toggle="dropdown">
                <i class="fa fa-cog fa-2x"></i>
            </a>
            <ul class="dropdown-menu">
                <li class="header-title">配置</li>
                <li class="adjustments-line">
                    <a href="javascript:void(0)" class="switch-trigger">
                        <p>侧边栏背景</p>
                        <div class="switch switch-sidebar-image"
                            data-on-label="ON"
                            data-off-label="OFF">
                            <input type="checkbox" checked />
                        </div>
                        <div class="clearfix"></div>
                    </a>
                </li>
                <li class="adjustments-line">
                    <a href="javascript:void(0)" class="switch-trigger">
                        <p>侧边栏迷你版</p>
                        <div class="switch  switch-sidebar-mini"
                            data-on-label="ON"
                            data-off-label="OFF">
                            <input type="checkbox" />
                        </div>
                        <div class="clearfix"></div>
                    </a>
                </li>
                <li class="adjustments-line">
                    <a href="javascript:void(0)" class="switch-trigger">
                        <p>固定导航栏</p>
                        <div class="switch  switch-navbar-fixed"
                            data-on-label="ON"
                            data-off-label="OFF">
                            <input type="checkbox" />
                        </div>
                        <div class="clearfix"></div>
                    </a>
                </li>
                <li class="adjustments-line">
                    <a href="javascript:void(0)" class="switch-trigger">
                        <p>颜色</p>
                        <div class="pull-right">

                            <span class="badge filter" data-color="black"></span>
                            <span class="badge filter badge-azure active" data-color="azure"></span>
                            <span class="badge filter badge-green" data-color="green"></span>
                            <span class="badge filter badge-orange" data-color="orange"></span>
                            <span class="badge filter badge-red" data-color="red"></span>
                            <span class="badge filter badge-purple" data-color="purple"></span>
                        </div>
                        <div class="clearfix"></div>
                    </a>
                </li>
                <li class="header-title">侧边栏图片</li>
                <li>
                    <a class="img-holder switch-trigger" href="javascript:void(0)">
                        <img src="~/Content/picture/full-screen-image-1.jpg" />
                    </a>
                </li>
                <li>
                    <a class="img-holder switch-trigger" href="javascript:void(0)">
                        <img src="~/Content/picture/full-screen-image-2.jpg" />
                    </a>
                </li>
                <li>
                    <a class="img-holder switch-trigger" href="javascript:void(0)">
                        <img src="~/Content/picture/full-screen-image-3.jpg" />
                    </a>
                </li>
                <li class="active">
                    <a class="img-holder switch-trigger" href="javascript:void(0)">
                        <img src="~/Content/picture/full-screen-image-4.jpg" />
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <!--   Core JS Files and PerfectScrollbar library inside jquery.ui   -->
    <script src="../Content/js/jquery.min.js" type="text/javascript"></script>
    <script src="../Content/js/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Content/js/bootstrap.min.js" type="text/javascript"></script>

    <script src="~/Content/js/moment.js"></script>

    <script src="../Content/js/daterangepicker.js"></script>
    <!--  Forms Validations Plugin -->
    <script src="../Content/js/jquery.validate.min.js"></script>

    <!--  Plugin for Date Time Picker and Full Calendar Plugin-->
    <script src="../Content/js/moment.min.js"></script>

    <!--  Date Time Picker Plugin is included in this js file -->
    <script src="../Content/js/bootstrap-datetimepicker.js"></script>

    <!--  Select Picker Plugin -->
    <script src="../Content/js/bootstrap-selectpicker.js"></script>

    <!--  Checkbox, Radio, Switch and Tags Input Plugins -->
    <script src="../Content/js/bootstrap-checkbox-radio-switch-tags.js"></script>

    <!--  Charts Plugin -->
    <script src="../Content/js/chartist.min.js"></script>

    <!--  Notifications Plugin    -->
    <script src="../Content/js/bootstrap-notify.js"></script>

    <!-- Sweet Alert 2 plugin -->
    <script src="../Content/js/sweetalert2.js"></script>

    <!-- Vector Map plugin -->
    <script src="../Content/js/jquery-jvectormap.js"></script>

    <!--  Google Maps Plugin    -->
    <script src="../Content/js/aa743e8f448a4792bad10d201a7080f6.js"></script>

    <!-- Wizard Plugin    -->
    <script src="../Content/js/jquery.bootstrap.wizard.min.js"></script>

    <!--  Bootstrap Table Plugin    -->
    <script src="../Content/js/bootstrap-table.js"></script>

    <!--  Plugin for DataTables.net  -->
    <script src="../Content/js/jquery.datatables.js"></script>

    <!--  Full Calendar Plugin    -->
    <script src="../Content/js/fullcalendar.min.js"></script>

    <!-- Light Bootstrap Dashboard Core javascript and methods -->
    <script src="../Content/js/light-bootstrap-dashboard.js"></script>

    <!--   Sharrre Library    -->
    <script src="../Content/js/jquery.sharrre.js"></script>

    <!-- Light Bootstrap Dashboard DEMO methods, don't include it in your project! -->
    <script src="../Content/js/demo.js"></script>
    <script src="~/Content/js/jquery.form.js"></script>
    @*@Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)*@
    @if (ViewBag.Title == "图书类型")
    {
        <script type="text/javascript">
            var $table = $('#bootstrap-table');
            $().ready(function () {
                window.operateEvents = {
                    'click .remove': function (e, value, row, index) {
                        console.log(row);
                        swal({
                            title: "确定删除吗?",
                            text: "",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            closeOnConfirm: false,
                            closeOnCancel: false
                        }, function (isConfirm) {
                            if (isConfirm) {
                                $.ajax({
                                    type: "POST",
                                    url: '/BooksManage/RemoveBookType',
                                    data: 'id=' + [row.id],
                                    error: function (request) {
                                        swal("删除失败", "", "error");
                                    },
                                    success: function (data) {
                                        swal("删除成功", "", "success");
                                        $table.bootstrapTable('remove', {
                                            field: 'id',
                                            values: [row.id]
                                        });
                                    }
                                });
                            } else {
                                swal("取消删除", "", "error");
                            }
                        });
                    }
                };
                table();
            });

        </script>
    }

    @if (ViewBag.Title == "图书信息")
    {
        <script type="text/javascript">
            var $table = $('#bootstrap-table');
            $().ready(function () {
                window.operateEvents = {
                    'click .remove': function (e, value, row, index) {
                        console.log(row);
                        swal({
                            title: "确定删除吗?",
                            text: "",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            closeOnConfirm: false,
                            closeOnCancel: false
                        }, function (isConfirm) {
                            if (isConfirm) {
                                $.ajax({
                                    type: "POST",
                                    url: '/BooksManage/RemoveBookInfo',
                                    data: 'id=' + [row.id],
                                    error: function (request) {
                                        swal("删除失败", "", "error");
                                    },
                                    success: function (data) {
                                        swal("删除成功", "", "success");
                                        $table.bootstrapTable('remove', {
                                            field: 'id',
                                            values: [row.id]
                                        });
                                    }
                                });
                            } else {
                                swal("取消删除", "", "error");
                            }
                        });
                    }
                };
                table();
            });

        </script>
    }
    <script type="text/javascript">
        function table() {
            $table.bootstrapTable({
                toolbar: ".toolbar",
                clickToSelect: true,
                showRefresh: true,
                search: true,
                showToggle: true,
                showColumns: true,
                pagination: true,
                searchAlign: 'left',
                pageSize: 10,
                clickToSelect: false,
                pageList: [10, 15, 25, 50, 100],

                formatShowingRows: function (pageFrom, pageTo, totalRows) {
                    //do nothing here, we don't want to show the text "showing x of y from..."
                },
                formatRecordsPerPage: function (pageNumber) {
                    return pageNumber + " 显示行数";
                },
                icons: {
                    refresh: 'fa fa-refresh',
                    toggle: 'fa fa-th-list',
                    columns: 'fa fa-columns',
                    detailOpen: 'fa fa-plus-circle',
                    detailClose: 'fa fa-minus-circle'
                }
            });

            //activate the tooltips after the data table is initialized
            $('[rel="tooltip"]').tooltip();

            $(window).resize(function () {
                $table.bootstrapTable('resetView');
            });
        }
    </script>
</body>
</html>
